package com.gsm.processor;

import com.gsm.log.MyLogger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class MyBeanPostProcessor implements BeanPostProcessor {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		MyLogger.log(bean);
		MyLogger.log("postProcessBeforeInitialization", beanName);
		MyLogger.separator();
		return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		MyLogger.log(bean);
		MyLogger.log("postProcessAfterInitialization", beanName);
		MyLogger.separator();
		return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
	}
}
